package cola0502.project.hellospringbootcola0502.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@Configuration
public class SwaggerConfiguration {

    @Bean
    public Docket docket(){
        ApiInfo apiInfo = new ApiInfoBuilder()
            .contact(new Contact("Cola0502", "https://gitee.com/cola0223", "1203952894@qq.com"))
            .title("HelloSpringBoot-Cola0502 Swagger")
            .build();
        return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo)
            .select()
            .apis(RequestHandlerSelectors.basePackage("cola0502.project.hellospringbootcola0502.controller"))
            .build();
    }
}
